package com.xiaozhi.bean;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;

public class Cat2 implements InitializingBean {
	private String name;

	public Cat2() {
		System.out.println("cat 被初始化了...");
	}

	@Value("${JAVA_HOME}")//自动赋值功能
	public void setName(String name) {
		this.name = name;
	}


	public String getName() {
		return name;
	}

	@Override//【9】. 实现了InitializingBean,方法afterPropertiesSet执行
	public void afterPropertiesSet() throws Exception {
		System.out.println("Cat2 afterPropertiesSet coming....");
	}
}
